<?php
namespace App\DataBase;

/**
 * Class IteratorTrait
 * @package Lib\Database
 *
 * @property $_rawData
 */
trait IteratorTrait
{
    /**
     * @return mixed
     */
    public function current()
    {
        return current($this->_rawData);
    }

    /**
     * @return array
     */
    public function key()
    {
        return key($this->_rawData);
    }

    /**
     * @return mixed
     */
    public function next()
    {
        return next($this->_rawData);
    }

    /**
     * return void
     */
    public function rewind()
    {
        reset($this->_rawData);
    }

    /**
     * @return bool
     */
    public function valid()
    {
        return $this->current() !== false;
    }
}